package org.celery.modules.purchase.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum PurchaseStatusEnum {
    UNPAID("未付款",  1),
    PAYED("拼单进行中",  2),
    UNDER_DELIVER("拼单成功，待发货",  3),
    CANCEL("交易取消",  4),
    ;
    private final String name;
    private final int value;

    public static String getName(int value) {
        if (value == 1) {
            return UNPAID.getName();
        } else if (value == 2) {
            return PAYED.getName();
        } else if (value == 3) {
            return UNDER_DELIVER.getName();
        } else if (value == 4) {
            return CANCEL.getName();
        }
        return "";
    }
}
